/**
 * 
 */
package p_01;

import java.util.TreeMap;
import java.util.LinkedList;
/**
 * @author GuilhermePedrosa
 *
 */
public class Grid {
	private TreeMap<Pair<Integer, Integer>, Pair<Integer, Integer>> mygrid = new TreeMap<Pair<Integer,Integer>, Pair<Integer,Integer>>();
	private Pair<Integer, Integer> startPos;
	private Pair<Integer, Integer> endPos;
	private LinkedList<Pair<Integer, Integer>> blockages; 
	/**
	 * @param mygrid
	 * @param startPos
	 * @param endPos
	 */
	
	public Grid(
			TreeMap<Pair<Integer, Integer>, Pair<Integer, Integer>> mygrid,
			Pair<Integer, Integer> startPos,
			Pair<Integer, Integer> endPos, LinkedList<Pair<Integer, Integer>> blockages) {
		super();
		this.mygrid = mygrid;
		this.startPos = startPos;
		this.endPos = endPos;
		this.blockages = blockages;
	}
	
	public Grid (){
	}
	/**
	 * @return the mygrid
	 */
	public TreeMap<Pair<Integer, Integer>, Pair<Integer, Integer>> getMygrid() {
		return mygrid;
	}
	/**
	 * @return the startPos
	 */
	public Pair<Integer, Integer> getStartPos() {
		return startPos;
	}
	/**
	 * @return the endPos
	 */
	public Pair<Integer, Integer> getEndPos() {
		return endPos;
	}
	/**
	 * @param mygrid the mygrid to set
	 */
	public void setMygrid(
			TreeMap<Pair<Integer, Integer>, Pair<Integer, Integer>> mygrid) {
		this.mygrid = mygrid;
	}
	/**
	 * @param startPos the startPos to set
	 */
	public void setStartPos(Pair<Integer, Integer> startPos) {
		this.startPos = startPos;
	}
	/**
	 * @param endPos the endPos to set
	 */
	public void setEndPos(Pair<Integer, Integer> endPos) {
		this.endPos = endPos;
	}
	
	public void initGrid (){
		Pair <Integer, Integer> block;
		Pair <Integer, Integer> pos;
		for (int i = 0 ; i<= endPos.getFirst(); i++){
			for (int j = 0 ; j<= endPos.getSecond(); j++){
				pos = new Pair<Integer, Integer>(i, j);
				while (blockages.iterator().hasNext()){
					block = blockages.iterator().next();
//					if (block.equals(pos))
//						mygrid.put(pos, arg1)
				}
			}
		}
	}
}
